﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using HoneyBadgersOfficePlayer.Models;


namespace HoneyBadgersOfficePlayer.Views
{
    public partial class StreamDemo : System.Web.UI.Page
    {
        protected int userID;
        protected int roomID;        

        protected void Page_Load(object sender, EventArgs e)
        {
            userID = Globals.UserID;            
            roomID = Globals.RoomID;
                        
            List<SqlParameter> parameterList = new List<SqlParameter>();
            parameterList.Add(new SqlParameter("@Room_id", Globals.RoomID));

            SqlDataReader reader;
            reader = SQLUtilities.RunStoredProcedure("GetRoomInfo", parameterList);

            if (reader != null && reader.HasRows)
            {
                reader.Read();
                roomName.Text = reader[0].ToString();
            }
            else
                roomName.Text = "Default Room";
        }

        
        protected void bLeave_Click(object sender, EventArgs e)
        {
            Response.Write("<script type='text/javascript'>window.open('Rooms.aspx','_self');</script>");
        }

    }
}